# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1287517883.4479959
_template_filename='/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/dictionary/browse.html'
_template_uri='/derived/dictionary/browse.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['heading']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    # SOURCE LINE 3
    ns = runtime.Namespace(u'formViews', context._clean_inheritance_tokens(), templateuri=u'/base/formViews.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'formViews')] = ns

    # SOURCE LINE 4
    ns = runtime.Namespace(u'javascriptDefs', context._clean_inheritance_tokens(), templateuri=u'/base/javascriptDefs.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'javascriptDefs')] = ns

def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/base/index.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, u'formViews')._populate(_import_ns, [u'*'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'*'])
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        languageToSortBy = _import_ns.get('languageToSortBy', context.get('languageToSortBy', UNDEFINED))
        url = _import_ns.get('url', context.get('url', UNDEFINED))
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        formViews = _mako_get_namespace(context, 'formViews')
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        hasattr = _import_ns.get('hasattr', context.get('hasattr', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n\n')
        # SOURCE LINE 3
        __M_writer(u'\n')
        # SOURCE LINE 4
        __M_writer(u'\n\n')
        # SOURCE LINE 6
        __M_writer(u'\n  \n')
        # SOURCE LINE 8

        allByOLURL = url(controller='dictionary', action='browse', id='1000000_ol', anchor='hl')
        allByMLURL = url(controller='dictionary', action='browse', id='1000000_ml', anchor='hl')    
        
        
        __M_locals_builtin_stored = __M_locals_builtin()
        __M_locals.update(__M_dict_builtin([(__M_key, __M_locals_builtin_stored[__M_key]) for __M_key in ['allByOLURL','allByMLURL'] if __M_key in __M_locals_builtin_stored]))
        # SOURCE LINE 11
        __M_writer(u'\n            \n<div class="centerHeading">\n    <a href="')
        # SOURCE LINE 14
        __M_writer(escape(allByOLURL))
        __M_writer(u'" title="')
        __M_writer(escape('view all entries; %s-to-%s' % (app_globals.objectLanguageName, app_globals.metaLanguageName)))
        __M_writer(u'">')
        __M_writer(escape(app_globals.objectLanguageName))
        __M_writer(u'</a>\n</div>\n\n')
        # SOURCE LINE 17
        if c.OLOrthographyTable:
            # SOURCE LINE 18
            __M_writer(u'    ')
            __M_writer(escape(c.OLOrthographyTable))
            __M_writer(u'\n')
            # SOURCE LINE 19
        else:
            # SOURCE LINE 20
            __M_writer(u'    Please specify an orthography in the application settings\n')
            pass
        # SOURCE LINE 22
        __M_writer(u'    \n<div class="centerHeading">\n    <a href="')
        # SOURCE LINE 24
        __M_writer(escape(allByMLURL))
        __M_writer(u'" title="')
        __M_writer(escape('view all entries; %s-to-%s' % (app_globals.metaLanguageName, app_globals.objectLanguageName)))
        __M_writer(u'">')
        __M_writer(escape(app_globals.metaLanguageName))
        __M_writer(u'</a>\n</div>\n\n')
        # SOURCE LINE 27
        if c.MLOrthographyTable:
            # SOURCE LINE 28
            __M_writer(u'    ')
            __M_writer(escape(c.MLOrthographyTable))
            __M_writer(u'\n')
            # SOURCE LINE 29
        else:
            # SOURCE LINE 30
            __M_writer(u'    Please specify an orthography in the application settings\n')
            pass
        # SOURCE LINE 32
        __M_writer(u'\n\n')
        # SOURCE LINE 34
        if hasattr(c, 'headChar'):
            # SOURCE LINE 35
            if c.headChar:
                # SOURCE LINE 36
                __M_writer(u'        <div id="headCharDiv"><a name=\'hl\'></a>')
                __M_writer(escape(h.storageToOutputTranslate(c.headChar[0])))
                __M_writer(u'</div>\n')
                # SOURCE LINE 37
            else:
                # SOURCE LINE 38
                __M_writer(u'        <div id="headCharDiv"><a name=\'hl\'></a></div>\n')
                pass
            pass
        # SOURCE LINE 41
        __M_writer(u'\n\n')
        # SOURCE LINE 43
        if hasattr(c, 'wordList'):
            # SOURCE LINE 44
            for form in c.wordList:
                # SOURCE LINE 45
                __M_writer(u'        ')
                __M_writer(escape(formViews.dictionaryView(form, languageToSortBy)))
                __M_writer(u'\n')
                pass
            pass
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'formViews')._populate(_import_ns, [u'*'])
        _mako_get_namespace(context, u'javascriptDefs')._populate(_import_ns, [u'*'])
        __M_writer = context.writer()
        return ''
    finally:
        context.caller_stack._pop_frame()


